package com.ios.common.dao;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;

@Repository("commonDAO")
public class CommonDAO implements ICommonDAO{// extends HibernateDaoSupport

	public final Log loggger = LogFactory.getLog(this.getClass());
	@Autowired
	@Qualifier("jdbcTemplate")
	private JdbcTemplate jdbcTemplate;

	@Autowired
	@Qualifier("hibernateTemplate")
	private HibernateTemplate hibernateTemplate;

	/**
	 * 获取记录总数
	 * 
	 * @param sql
	 * @return
	 */
	public int findCount(String sql) {
		return 0;
	}

	/**
	 * 分页查询方法
	 * 
	 * @param currentpage
	 * @param clazz
	 * @param sql
	 * @return
	 */
	public List queryObjetsForPangination(int currentpage, Class clazz, String sql) {
		return null;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}

	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	public HibernateTemplate getHibernateTemplate() {
		return hibernateTemplate;
	}

	public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
		this.hibernateTemplate = hibernateTemplate;
	}
}
